#define LOG(_f, _a...) dolog(__FILE__, __LINE__, __func__, _f "\n", ##_a)
+static void dolog(const char *file, int line, const char *func, char *fmt, ...)
+ __attribute__((format(printf,4,5)));
+
static void dolog(const char *file, int line, const char *func, char *fmt, ...)
{
va_list ap;
action = d_config->on_watchdog;
break;
default:
- LOG("Unknown shutdown reason code %s. Destroying domain.", info->shutdown_reason);
+ LOG("Unknown shutdown reason code %d. Destroying domain.", info->shutdown_reason);
action = ACTION_DESTROY;
}
}
rc = libxl_create_logfile(&ctx, name, &fullname);
if (rc) {
- LOG("failed to open logfile %s",fullname,strerror(errno));
+ LOG("failed to open logfile %s: %s",fullname,strerror(errno));
exit(-1);
}